﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Cataloger.Okna.Podstawowe
{
    public partial class FrmKatalogStartowy : Form
    {
		#region Fields (1) 

        string sciezkaKatalogu;

        public string SciezkaKatalogu
        {
            get { return sciezkaKatalogu; }
        }

		#endregion Fields 

		#region Constructors (1) 

        public FrmKatalogStartowy()
        {
            InitializeComponent();
            textBox1.Text = Globalne.KatalogStartowy;
        }
     
		#endregion Constructors 

		#region Methods (1) 

		// Private Methods (1) 

        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog op = new OpenFileDialog();
            op.AutoUpgradeEnabled = true;
            op.CheckFileExists = true;
            op.CheckPathExists = true;
            // op.Filter = ".ccat";
            op.DefaultExt = ".ccat";
            op.DereferenceLinks = true;
            op.InitialDirectory = Globalne.SciezkaFolderuKatalogow;
            op.Multiselect = false;
            op.Filter = "Pliki katalogow (*.ccat)|*.ccat";
            op.FilterIndex = 1;
            op.RestoreDirectory = true;

            op.Title = "Wybierz katalog startowy";

            if (op.ShowDialog() == DialogResult.OK)
            {
                sciezkaKatalogu = op.FileName;
                textBox1.Text = op.FileName;
                             
            }
        }

		#endregion Methods 

        private void button3_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.Close();
          
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.textBox1.Text = "";
            this.sciezkaKatalogu = "";
        }

        private void button4_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}
